package o;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

public class cty {
    private static String ˋ = "PushMessageCenter";
    private static cty ˎ = null;
    private static final Object ˏ = new Object();
    private Map<String, Class> ˊ = new HashMap();
    private Map<String, Class> ॱ = new HashMap();
    private Set<Class> ॱॱ = new HashSet();

    public static cty ˎ() {
        cty o_cty;
        synchronized (ˏ) {
            if (ˎ == null) {
                ˎ = new cty();
            }
            o_cty = ˎ;
        }
        return o_cty;
    }

    public List<String> ˏ() {
        List<String> arrayList = new ArrayList();
        for (Entry key : this.ˊ.entrySet()) {
            arrayList.add((String) key.getKey());
        }
        return arrayList;
    }

    public Class ˋ(String str) {
        return (Class) this.ˊ.get(str);
    }

    public void ˎ(Class<? extends cue> cls, String... strArr) {
        for (Object put : strArr) {
            this.ॱ.put(put, cls);
        }
    }

    public cue ˎ(String str) {
        Object newInstance;
        try {
            newInstance = ((Class) this.ॱ.get(str)).newInstance();
        } catch (InstantiationException e) {
            Logger.e(ˋ, "get PushHandler falid" + e.getMessage());
            newInstance = null;
        } catch (IllegalAccessException e2) {
            Logger.e(ˋ, "get PushHandler falid" + e2.getMessage());
            newInstance = null;
        }
        if (newInstance instanceof cue) {
            return (cue) newInstance;
        }
        return null;
    }

    public void ˎ(Class<? extends cub> cls) {
        this.ॱॱ.add(cls);
    }

    public Set<cub> ˊ() {
        Set<cub> hashSet = new HashSet();
        for (Class newInstance : this.ॱॱ) {
            Object newInstance2;
            try {
                newInstance2 = newInstance.newInstance();
            } catch (InstantiationException e) {
                Logger.e(ˋ, "get PushHandler falid" + e.getMessage());
                newInstance2 = null;
            } catch (IllegalAccessException e2) {
                Logger.e(ˋ, "get PushHandler falid" + e2.getMessage());
                newInstance2 = null;
            }
            if (newInstance2 instanceof cub) {
                hashSet.add((cub) newInstance2);
            }
        }
        return hashSet;
    }
}
